package com.xfcy.blog.dto;

import com.xfcy.blog.valid.AddGroup;
import com.xfcy.blog.valid.UpdateGroup;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;


import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

/**
 * @author 晓风残月Lx
 * @date 2023/5/14 17:43
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class LoginDTO {

    @Pattern(regexp = "^[a-zA-Z]+$", groups = {AddGroup.class, UpdateGroup.class})
    @NotBlank(message = "用户名不能为空", groups = {AddGroup.class, UpdateGroup.class})
    @Size(min = 3, max = 20, message = "用户名长度必须大于等于3",  groups = {AddGroup.class, UpdateGroup.class})
    private String username;

    @Size(min = 6, max = 20, message = "密码长度必须大于等于6",  groups = {AddGroup.class, UpdateGroup.class})
    @NotBlank(message = "密码不能为空", groups = {AddGroup.class, UpdateGroup.class})
    private String password;

    @NotBlank(message = "UUID不能为空", groups = {AddGroup.class, UpdateGroup.class})
    private String uuid;

    @NotBlank(message = "验证码不能为空", groups = {AddGroup.class, UpdateGroup.class})
    private String code;


    private Boolean rememberMe;

}
